<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>浏览器</title>
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我的</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>
    <style>
    html,body{
        height: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
        background-size:100%;
        background: transparent;
    }
    img{
      width: 100%;
      height: 100%;
    }
    .collect{
      background-image:url('../../image/home_icon_collect.png');
    }
    .collected{
      background-image:url('../../image/home_icon_collected.png');
    }
    </style>
</head>
<body  >
  <div id="app"  style="width:100%;height:100%;background-size:100%" v-myclick="collection" class="collected" ></div>
</body>
<script src="../../script/vue.js"></script>
<script src="../../script/api.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script>
    var vm;
    var goodsselected= [];
    var iscollect =false;
    var collect;
    apiready = function () {

        setBSImg();
        goods_info = api.pageParam.goods_info;
        var data = {
            member_id: getPrefs('member_id'),
            good: JSON.stringify(goods_info),
        };
        var callback = function (ret) {
          collect = ret.content.status;
          if(collect==1){
            iscollect=true;
          }else{
            iscollect=false;
          }
          initApp();
        };
        pinet.post(URL.getMycollect, data, callback);
        api.parseTapmode();
    };

    function initApp() {
        vm = new Vue({
            el: '#app',
            data: {
              goods_info:goods_info,
              collect:collect
            },
            methods: {
              collection:function(){
                if (!getPrefs('token')) {
                    reLogin();
                    return;
                }
                user = JSON.parse(getPrefs('user'));
                member_type = user.member_type;
                if(member_type==6){
                  openWin('shoplibrary');
                }else{
                  openWin('shopcollect');
                }
              },
            },
            created: function () {
            }
        })
    }
</script>
</html>
